﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.CodeDom.Compiler;
using System.Runtime.Remoting.Messaging;

namespace Bing.Studio
{
    //public class T4Output
    //{
    //    public String TemplateContent { get; private set; }

    //    public List<String> Errors { get; private set; }

    //    public T4Output(string content)
    //    {
    //        TemplateContent = content;
    //        Errors = new List<string>();
    //    }

    //    public string Generation(object data)
    //    {
    //        //CustomTextTemplatingEngineHost host = new CustomTextTemplatingEngineHost();
    //        //host.TemplateFileValue = "test.tt";
    //        //host.Session = new TextTemplatingSession();
    //        //host.Session.Add("Data", data);
    //        //Engine engine = new Engine();
    //        //string result = engine.ProcessTemplate(TemplateContent, host);
    //        //foreach (CompilerError error in host.Errors)
    //        //{
    //        //    Errors.Add(error.ErrorText);
    //        //}
    //        //return result;
    //        TableHost host = new TableHost() { Test = "abc", TemplateFile = "test.tt" };
            
    //        string result = new Engine().ProcessTemplate(TemplateContent, host);

    //        foreach (CompilerError error in host.Errors)
    //        {
    //            Errors.Add(error.ErrorText);
    //        }
    //        return result;
    //    }
    //}
}
